package com.boolib.http.core;


import com.boolib.http.core.defaults.DefaultHttpChain;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wfq
 */

@Configuration
public class InitConfig {



    @Bean
    public DefaultHttpChain defaultHttpChain(){
        return  new DefaultHttpChain();
    }

    @Bean
    public FilterRegistrationBean registrationBean(DefaultHttpChain defaultHttpChain){

        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();;

        filterRegistrationBean.setFilter(defaultHttpChain);

        filterRegistrationBean.addUrlPatterns("/*");

        return filterRegistrationBean;

    }
}
